#!/usr/bin/env python

import rospy
from std_srvs.srv import Empty
from roah_devices.msg import DevicesState

def callback(status):
	#only for testing
	sw1 = status.switch_1
	sw2 = status.switch_2
	sw3 = status.switch_3
	d = status.dimmer
	b = status.blinds
	
	s = sw1, sw2, sw3, d, b
	rospy.loginfo(s)
	
	return sw1, sw2, sw3, d, b
    
def listener():
    rospy.init_node('server_listener', anonymous=True)
    rospy.Subscriber('devices/state', DevicesState, callback)
    # spin() simply keeps python from exiting until this node is stopped
    rospy.spin()
        
if __name__ == '__main__':
    listener()
